package com.dailywork.basepro.extend;

import lombok.Getter;
import lombok.Setter;

import java.util.Comparator;

@Getter
@Setter
public class PersonCompareto implements Comparator<PersonCompareto> {

    String name;
    String address;

    @Override
    public int compare(PersonCompareto personCompareto1, PersonCompareto personCompareto2) {
        if (personCompareto1.getName().length() > personCompareto2.getName().length()) {
            return 1;
        } else if (personCompareto1.getName().length() == personCompareto2.getName().length()) {
            return 0;
        } else {
            return -1;
        }
    }
}
